using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Fly : MonoBehaviour, IFly
{
    [Header("飞行角度")]
    [SerializeField] private float angleInDegrees;
    
    public Vector2 GetFlySpeed()
    {
        // 将角度从度转换为弧度
        float angleInRadians = Mathf.Deg2Rad * angleInDegrees;
    
        // 计算单位向量的x和y分量
        float x = Mathf.Cos(angleInRadians);
        float y = Mathf.Sin(angleInRadians);
    
        // 返回单位向量
        return new Vector2(x, y).normalized; // 确保向量是归一化的
    }
}
